import { EstateQqMapComponent } from './estate-qqmap/estate-qqmap.component';
import { EstateEvaluatingComponent } from './estate-evaluating/estate-evaluating.component';
import { EstateCommentDetailComponent } from './estate-comment-detail/estate-comment-detail.component';
import { EstateNewsDetailComponent } from './estate-news-detail/estate-news-detail.component';
import { RouterModule, Routes } from '@angular/router'

import { EstateComponent } from './estate.component'
import { IndexComponent } from './index/index.component'
import { EstateDetailComponent } from './estate-detail/estate-detail.component'
import { EstateInfoComponent } from './estate-info/estate-info.component'
import { EstateNewsComponent } from './estate-news/estate-news.component'
import { EstateTestComponent } from './estate-test/estate-test.component'
import { EstateTypeComponent } from './estate-type/estate-type.component'
import { EstateCommentComponent } from './estate-comment/estate-comment.component'
import { EstateQuestionComponent } from './estate-question/estate-question.component'
import { EstateAroundComponent } from './estate-around/estate-around.component'
import { EstateQuestionDetailComponent } from './estate-question-detail/estate-question-detail.component'
import { EstateAppointComponent } from './estate-appoint/estate-appoint.component'
import { EstateImagesComponent } from './estate-images/estate-images.component'
import { EstateTypeDetailComponent } from './estate-type-detail/estate-type-detail.component'

const appRoutes: Routes = [
  {
    path: '',
    component: EstateComponent,
    children: [
      {
        path: '',
        children: [
          { path: '', redirectTo: 'index', pathMatch: 'full' },
          { path: 'index', component: IndexComponent, data: { title: '楼盘列表', depth: 2 } },
          { path: 'detail', component: EstateDetailComponent, data: { title: '楼盘详情', depth: 3 } },
          { path: 'info', component: EstateInfoComponent, data: { title: '', depth: 6 } },
          { path: 'news', component: EstateNewsComponent, data: { title: '动态列表', depth: 4 } },
          { path: 'appoint', component: EstateAppointComponent, data: { title: '预约看房', depth: 4 } },
          { path: 'test', component: EstateTestComponent, data: { title: '楼盘评测', depth: 4 } },
          { path: 'type', component: EstateTypeComponent, data: { title: '户型列表', depth: 4 } },
          { path: 'typeDetail', component: EstateTypeDetailComponent, data: { title: '户型详情', depth: 5 } },
          { path: 'comment', component: EstateCommentComponent, data: { title: '楼盘点评', depth: 4 } },
          { path: 'question', component: EstateQuestionComponent, data: { title: '问问大家', depth: 4 } },
          { path: 'questionDetail', component: EstateQuestionDetailComponent, data: { title: '问答详情', depth: 5 } },
          { path: 'around', component: EstateAroundComponent, data: { title: '周边配套', depth: 4 } },
          { path: 'newsDetail', component: EstateNewsDetailComponent, data: { title: '动态详情', depth: 4 } },
          { path: 'commentDetail', component: EstateCommentDetailComponent, data: { title: '评论详情', depth: 4 } },
          { path: 'estateEvaluating', component: EstateEvaluatingComponent, data: { title: '楼盘点评', depth: 4 } },
          { path: 'estateQqMap', component: EstateQqMapComponent, data: { title: '楼盘地图', depth: 4 } },
          { path: 'images', component: EstateImagesComponent, data: { title: '楼盘图片', depth: 4 } }
        ]
      }
    ]
  }
]

export const router = RouterModule.forChild(appRoutes)
